package cn.tedu.arrays;

import java.util.Arrays;

public class Test1_Arrays {
    public static void main(String[] args) {
        method();
        method2();
        method3();
    }
    public static void method3(){
        int[] a = {1,3,4,6,7};
        int[] b = Arrays.copyOf(a,6);
        System.out.println(Arrays.toString(b));

        int[] c = Arrays.copyOf(a,3);
        System.out.println(Arrays.toString(c));
    }
    public static void method2(){
        int[] a = {10,5,9,1,8};
        Arrays.sort(a);
        System.out.println(Arrays.toString(a));
    }
    public static void method(){
        int[] a = new int[5];
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
        String s = Arrays.toString(a);
        System.out.println(s);

        System.out.println(Arrays.toString(a));
    }
}
